<div data-page="Subject_tiku" class="page my_subject lesson_detail" >
 <input type="hidden" id="knowsid" value="<{$knowsid}>" />
 <script>
 var video_info=<{:json_encode($knowsData['video_info'])}>;
 </script>
	<style>
	.tabPaneContent{ padding:10px; min-height:200px}
	.page-content .tabPaneContent .ask-list-cp{ padding: 0px; }
	   .mid{ width: 100px;position:absolute; top: 50%; left: 50% ; margin-top: -20px; margin-left: -20px;}
   .mid img{ height: 40px }
	</style>
	<div class="page-content" >
	
 <div id="hide-content">
				<div class="col-md-8">
						<div id="videoWrapper" style="overflow:hidden;  width:100%;"  >
							 
						</div>
						 <div class="mid">
				             <img src="/Public/Images/play.png" id="play_img" style="display:none">
				             <img src="/Public/Images/loader.gif" id="load_img">
				          </div>
				</div>
		</div>		
				<div  class="action_box  col-md-4 mgt10 wap-padding-0"  style="background-color:#fff; ">
					<div id="action_box"  data-type="swiperPage" style=" position:relative"> 
					<ul class="nav nav-tabs text swiperTap" >
					<li class="active" style="margin-left:10px"><a href="#subject_list" class="text-center" data-toggle="tab">课程表</a></li> 
						<li class="" ><a href="#detail_notes" class="text-center" data-toggle="tab">笔记</a></li>
						<li class=""><a href="#post_ask" class="text-center" data-toggle="tab">提问</a></li>
						  <if condition="strip_tags($knowsData['task'])">
                <li class=""><a href="#task" class="text-center" data-toggle="tab">任务</a></li> 
                </if>
					</ul>
					<div class="tab-content swiperContent">
						
                  <div class="tab-pane active tabPane" id="subject_list">
								<div class="tabPaneContent" style="padding:0px;padding-bottom: 10px">
							<{:Widget('BoxEdu/Index/subject_list',array('subjectid'=>$subjectid,'url'=>'Subject/lesson_detail','show_down'=>1))}> 
								</div>
						</div>
						<div class="tab-pane  tabPane" id="detail_notes">
						<div class="tabPaneContent">
							<div id="detail_notes_content"><{$notes}></div>
							<div style="height: 50px;"></div>
							</div>
							
							
							<!-- <button id="btnSaveLessonNote" onclick="save_notes()" class="btn mgt20 btn-large btn-block btn-success" data-loading-text="保存中…" >写笔记</button> -->
						</div>
						<div class="tab-pane tabPane" id="post_ask">
						<div class="tabPaneContent">
						 <{:Widget( 'BoxSns/Topic/topicList/tpl/EduAskTopicList',array( 'type'=>'eduAsk','where'=>array('pid3'=>$knowsid)))}>
						<div style="height: 50px;"></div>

					 </div>
					<!--  -->
					</div>

						 <div class="tab-pane tabPane" id="task">
						 <div class="tabPaneContent">
                   <{$knowsData['task']}>
                   <div style="height: 50px;"></div>
                   </div>
                </div>
						
						
					</div>
    </div>
				</div>
		 
	</div>


	<div id="fixedBottoms">
		<div class="fixedBottom" id="fixedBottom1" data-type="popup" url="#LessonNoteDiv" style="text-align:center;display:none">
								写笔记
							</div>

		 <div class="fixedBottom" id="fixedBottom2" data-type="popup" h=1 url="<{:U('Subject/ask',array('pid'=>$subjectid,'pid2'=>$knowsData['knowssectionid'],'pid3'=>$knowsData['knowsid']))}>" style="text-align:center;display:none">
	        我要提问
	    </div>	
	</div>
						

	<div class="popup" id="LessonNoteDiv"  style="min-height:100%" >
									<div class="form-item">
									<div style="width:100%; min-height: 80px; max-height:400px;overflow-y:auto;padding: 10px;border-bottom: 1px solid #ededed;" contenteditable="true" id="contentNote" name="content" data-type="kindeditor" placeholder="请在这里写笔记内容" ><{$notes}></div>	 
									</div>
									
								   <div class="form-item-btn">
									<button type="button" class="btn colse btn-default btn-large a_bnt">取消</button>
									<button id="btnAsk" type="submit" data-loading-text="保存中…" id="btnSaveLessonNote" onclick="save_notes()" class="btn  btn-success btn-large a_bnt">保存</button>
									</div>
							</div>
	<script>
	//var CKobject;
	$(function(){
		$("#lessonList_bnt").click(function(event){
		  $(".page-content #lessonList").show();	
				event.stopPropagation()
				event.preventDefault()
		})	
		$("body").click(function(){
			$(".page-content #lessonList").hide();
		})
		

	})


$("#action_box").on("swiperSlide",function(event,swiper){
	//alert(swiper.activeIndex);
	$("#fixedBottom1").hide();
	$("#fixedBottom2").hide();
	$("#fixedBottom"+swiper.activeIndex).show();	
 	if(swiper.activeIndex==4){
		  $("#hide-content").slideUp(500);
				CKobject.getObjectById('ckplayer_videoWrapper').videoPause();
				 $('.page-content').animate({scrollTop:0});
		}else{
			 $("#hide-content").slideDown(500);
				//CKobject.getObjectById('ckplayer_videoWrapper').videoPlay();
		}
	
})	

$("#action_box").on("swiperSlideInit",function(event,swiper){
	 $("#action_box .learnchapter h3").unbind("click").bind("click",function(){
	 	    //var html=$(obj).html();
			//if(typeof(html)=="undefined"){
				var obj=$(this);
			//}
			$(obj).parent().find(".unstyled").toggle(400);
			 if($(obj).parent().find(".unstyled").css("display")=="none"){
				$(obj).find("span").removeClass("glyphicon-chevron-up").addClass("glyphicon-chevron-down");
			}else{	 
				$(obj).find("span").removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-up");	 
			}
	 })
})

	$("#play_img").click(function(){
		CKobject.getObjectById('ckplayer_videoWrapper').videoPlay();
		$("#play_img").hide();
		$("#ckplayer_videoWrapper").attr("controls","controls");
		var videoSeekTo="<{:intval($knowHistory['play_time'])}>";
                  if(videoSeekTo){
                  	 CKobject.getObjectById('ckplayer_videoWrapper').videoSeek(videoSeekTo);
                  } 
	})
		$("#videoWrapper").on("videoPlay",function(event){
			 // alert("videoPlay");	
			 	 $("#ckplayer_videoWrapper").removeAttr("controls");
				  $("#play_img").show();
                  $("#load_img").hide();
                  var videoSeekTo="<{:intval($knowHistory['play_time'])}>";
                  if(videoSeekTo){
                  	 CKobject.getObjectById('ckplayer_videoWrapper').videoSeek(videoSeekTo);
                  } 
				 
			})	
			$("#videoWrapper").on("videoPause",function(event){
			//  alert('videoPause');	
			})	
			//监听时间
			var timeArr={};
			$("#videoWrapper").on("videoTime",function(event){
				   // console.log(video_info);
								var play_id = "ckplayer_videoWrapper"; 
								var data=CKobject.getObjectById(play_id).getStatus();
								var time=parseInt(data['time']);
								if(time%2==0 && typeof(timeArr[time])=="undefined"){
									 $.post("/Subject/user_play_video",{type:1,time:time,knowsid:"<{$knowsid}>"})
								}
									timeArr[time]=time;
			})
			
			$("#videoWrapper").on("videoStop",function(event){
								var play_id = "ckplayer_videoWrapper"; 
								$.post("/Subject/user_play_video",{type:2,knowsid:"<{$knowsid}>"}) 
			})
			 	
			
	</script>
</div>
 
 
